<%-- 
    Document   : lookup
    Created on : Aug 28, 2011, 7:20:03 PM
    Author     : krisada
--%>
<%@page import="limousine.vo.Users"%>
<%@page import="limousine.util.Token"%>
<%@page import="org.jsrpc.bridge.Key"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib uri="/WEB-INF/jsrpc.tld" prefix="jsrpc"%>
<%@taglib uri="/WEB-INF/workforce.tld" prefix="work"%>
<!DOCTYPE html>
<% Users user = (Users) session.getAttribute(Token.USER_SESSION);
    if (user == null) {
        System.out.println("--SESSION EXPIRE--");
    }
%>
<jsrpc:broker>
    <jsrpc:register id="service" bean="workforce.limousine.service.TransportTariffManager"/>
    <jsrpc:register id="serviceLookup" bean="workforce.limousine.service.LookupSearchManager"/>  
    <script language="JavaScript" type="text/javascript" src="js/transportTariff.js"></script>

    <script language="JavaScript" type="text/javascript" src="js/ui.js"></script>    
    <script language="JavaScript" type="text/javascript" src="js/JTable.js"></script>
    <script language="JavaScript" type="text/javascript" src="js/table.js"></script>
    <script language="JavaScript" type="text/javascript" src="js/validation.js"></script>
    <script language="JavaScript" type="text/javascript" src="js/util.js"></script>

</jsrpc:broker>
<script language="JavaScript" type="text/javascript" src="jsrpc.js"></script>
<script language="JavaScript" type="text/javascript">
    

    <!--
    function initPage() {
    <%
        //String s = this.
        String s = request.getServletPath();
        System.out.println("login.jsp[" + s + "]");
        String sp[] = s.split("/");
        System.out.println("size:" + sp.length);
        StringBuffer sf = new StringBuffer();
        for (int i = 2; i < sp.length; i++) {
            //System.out.println("["+ sp[i]+"]");
            //  sf.append("../");
        }
        String pageId = (String) pageContext.getAttribute(Key.PAGE_ID);
        session.setAttribute("BACK_PATH." + pageId, sf.toString());
        sf.append(request.getScheme());
        sf.append("://");
        sf.append(request.getServerName());
        sf.append(":");
        sf.append(request.getServerPort());
        sf.append(request.getContextPath());
        sf.append("/BROKER-REGISTER?pageId=").append(pageId);
        System.out.println("path[" + sf.toString() + "]");
    %>
            initBroker("<%=sf.toString()%>");

            /*var search = document.getElementById("formSearch");
            search.style.visibility = "visible";
            var panel = document.getElementById("panel");
            search.style.top = panel.style.top;
            search.style.left = panel.style.left;*/
            formSearch();
                      
        }        
        -->
</script>
<link rel="stylesheet" type="text/css" href="css/workforce.css">
<body onload="initPage()">
    <div class="data_form" >
        <div class="head_data_form">
        </div>

        <div class="show_form">

            <table width="100%" border="0" cellspacing="10" cellpadding="0">
                <tr>
                    <td><strong>Transport Tariff</strong></td>
                </tr>
                <tr>
                    <td align="center">
                        <form action="/" id="actionForm" name="actionForm" >
                            <div id="panel" style="visibility: visible"></div>

                            <fieldset class="fieldsetForm"><legend><strong id="fieldSetLabel" >Transport Tariff Search</strong></legend>
                                <jsp:include page="sys_msg.jsp" />



                                <div id="formSearch" style="visibility: hidden; position: absolute; ">
                                    <table width="100%" border="0" align="center">
                                        <tr>
                                            <td align="right" width="45%"><work:label text="Distination"/></td>
                                            <td><work:text id="tDistination" tooltipText="Name of Distination use for search."/>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="center" colspan="2">
                                                <work:button id="bSearch" label="Search" onclick="search(0)"/>&nbsp;
                                                <work:button id="bAdd" label="Add New" onclick="setInsert()"/>&nbsp;                                                
                                            </td>
                                        </tr>
                                    </table>
                                    <br>
                                    <div class="divTableData">
                                        <table id="tableData" width="100%" border="0" align="center" >
                                            <thead id="tableDataHeader">
                                            </thead>
                                            <tbody id="tableDataBody" style="overflow: auto">
                                            </tbody>
                                            <tfoot id="tableDataFooter"></tfoot>
                                        </table>
                                    </div>
                                </div>

                                <div id="formEntry" style="visibility: hidden; position: relative; ">
                                    <table width="100%" border="0">
                                        <tr>
                                            <td align="right" width="35%"><work:label text="Table Id"/></td>
                                            <td><work:field-id id="tableId" name="tableId"/></td>
                                        </tr>
                                        <tr>
                                            <td align="right"><work:label text="Transport Tariff Id"/></td>
                                            <td><work:text id="transportId" name="transportId" /></td>
                                        </tr>
                                        <tr>
                                            <td align="right"><work:label text="Distination"/></td>
                                            <td><work:text id="distination"  tooltipText="Name of distination use."/></td>
                                        </tr>
                                        <tr>
                                            <td align="right"><work:label text="Area Type"/></td>
                                            <td><work:list id="areaType" tooltipText="Value of areaType use."/></td>
                                        </tr>                                        
                                        <tr>
                                            <td align="right"><work:label text="Area Cover"/></td>
                                            <td><work:text id="areaCover" tooltipText="Order of areaCover use."/></td>
                                        </tr>
                                         <tr>
                                            <td align="right"><work:label text="Time Usage"/></td>
                                            <td><work:text id="timeUsage" tooltipText="Order of timeUsage use."/></td>
                                        </tr>
                                        <tr>
                                            <td align="right"><work:label text="Postal Code Cover"/></td>
                                            <td><work:text id="postalCodeCover" tooltipText="Order of postalCodeCover use."/></td>
                                        </tr> 
                                        <tr>
                                            <td align="right"><work:label text="Rate Of Sedan"/></td>
                                            <td><work:text id="rateOfSedan" tooltipText="Order of rateOfSedan use."/></td>
                                        </tr>
                                        <tr>
                                            <td align="right"><work:label text="Rate Of Van"/></td>
                                            <td><work:text id="rateOfVan" tooltipText="Order of rateOfVan use."/></td>
                                        </tr>
                                        <tr>
                                            <td align="right"><work:label text="Order Id"/></td>
                                            <td><work:text id="orderId" tooltipText="Order of Transport Tariff."/></td>
                                        </tr>                                                                                 
                                        <tr>
                                            <td align="right"></td>
                                            <td><work:field-hidden id="createBy" name="createBy" value="<%=user.getId()%>"/>
                                                <work:field-hidden id="createDate" name="createDate" />
                                                <work:field-hidden id="updateBy" name="updateBy" value="<%=user.getId()%>"/>
                                                <work:field-hidden id="updateDate" name="updateDate" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="center" colspan="2">
                                                <work:button id="bSave" label="Save" onclick="insert()"/>&nbsp;
                                                <work:button id="bClear" label="Reset" onclick="setInsert()"/>&nbsp;
                                                <work:button id="bCancel" label="Cancel" onclick="formSearch()"/>
                                            </td>
                                        </tr>
                                        <tr height="20">
                                            <td align="right" colspan="2"></td>
                                        </tr>
                                    </table>
                                </div>

                            </fieldset>

                        </form>


                    </td>
                </tr>
            </table>

        </div>

        <div class="bottom_data_form">
        </div>

    </div>
</body>

